﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Asteroids.Menu
{
    /// <summary>
    /// Interaction logic for PauseScreen.xaml
    /// </summary>
    public partial class GameOverScreen : UserControl
    {
        public GameOverScreen()
        {
            InitializeComponent();

        }

        private void btnSubmit_Click(object sender, RoutedEventArgs e)
        {
            if (!String.IsNullOrEmpty(txtName.Text))
            {
                Game.Highscores.Instance.SaveScore(txtName.Text.Substring(0, 3));
                MainWindow.Instance.GameOverUC.Visibility = Visibility.Hidden;
                MainWindow.Instance.HighscoresUC.Visibility = Visibility.Visible;
            }
        }

        private void btnMainMenu_Click(object sender, RoutedEventArgs e)
        {
            MainWindow.Instance.GameOverUC.Visibility = Visibility.Hidden;
            MainWindow.Instance.MainMenuUC.Visibility = Visibility.Visible;
        }

        private void btnExit_Click(object sender, RoutedEventArgs e)
        {
            Environment.Exit(0);
        }
    }
}
